var LGDSTile = Class.create({
  initialize: function (x, y) {
    this.x = x;
    this.y = y;
    this.field;
    this.wall;
    // A special mask on tile. Offer a link, an optional
    // grid visual, a basic description when mouse hover
    // on each tile
    this.mask;
  },
  setField: function (field) {
    this.field = field;
  },
  setWall: function (wall) {
    this.wall = wall;
  },
  setMask: function (x, y, z, type) {
    switch(type) {
      case "field":
	  this.mask = new LGDSElement(BASE_URL_IMG+'mask/mask_on.png');
	  this.mask.setRollOverImg(BASE_URL_IMG+'mask/mask_hover.png');
	  this.mask.setPos(x, y, z);
      break;
      case "wall" :
	  this.mask = new LGDSElement(BASE_URL_IMG+'mask/mask_wall.png');
	  this.mask.setRollOverImg(BASE_URL_IMG+'mask/mask_hover.png');
	  this.mask.setPos(x, y, z);
      break;
    }
    // TODO ? this.mask.get().useMap = '#hexagone';
    this.mask.setEvent(this.onClick.bind(this));
  },
  // Switch on/off the grid visual
  gridOn: function () {
    this.mask.changeImg(BASE_URL_IMG+'mask/mask_on.png');
  },
  gridOff: function () {
    this.mask.changeImg(BASE_URL_IMG+'mask/mask_off.png');
  },
  onClick: function () {
    log.add(this.x + ' ' + this.y);
  }
});